package com.lovo.controller;

import com.lovo.entity.UserEntity;
import com.lovo.token.SysToken;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("boot")
@Api(tags = "登录")
public class LoginController {

    @ApiOperation(value = "登录系统返回token")
    @PostMapping("login")
    public String login(UserEntity user){
        if(user.getUserName().equals("zy")&&user.getPassword().equals("123456")){
            return     SysToken.createToken("power");
        }
        return "";
    }
}
